package com.hqyj.smvc.service.impl;

import com.hqyj.smvc.mapper.LoginMapper;
import com.hqyj.smvc.pojo.Employee;
import com.hqyj.smvc.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    private LoginMapper loginMapper;

    /**
     * 登录
     * @param employee 只封装了用户名和密码的雇员对象
     * @return 雇员对象
     */
    @Override
    public Employee loginEmployee(Employee employee){
        Employee employee1 = loginMapper.selectEmployee(employee);
        if(employee1 != null){
            return employee1;
        } else {
            return null;
        }
    }
}
